package com.wangsh.splider.system.pojo;

import java.util.Date;
import java.util.Map;
import java.util.TreeMap;

import com.wangsh.splider.common.pojo.BasePojo;

public class ASysWebSite extends BasePojo<ASysWebSite> {
	private int id;
	private String name;
	private String url;
	private String content;
	private byte status;
	private	Date createTime;
	private	Date updateTime;
	private Date pubTime;
	
	
	/*--字符串表示--*/
    private String statusStr ;
    /* 存储所有状态的容器 */
    private Map<String,String> enumsMap = new TreeMap<String, String>();

    public Map<String, String> getEnumsMap()
    {
        // 根据状态值获取字符串描述
    	ASysWebSiteEnum[] aSysWebSiteEnums = ASysWebSiteEnum.values();
        for (int i = 0; i < aSysWebSiteEnums.length; i++)
        {
        	ASysWebSiteEnum aSysWebSiteEnum = aSysWebSiteEnums[i];
            String key = aSysWebSiteEnum.toString() ;
            if(key.lastIndexOf("_") != -1)
            {
                key = key.substring(0,key.lastIndexOf("_")) ;
            }
            enumsMap.put(key + "-" + aSysWebSiteEnum.getStatus() + "", aSysWebSiteEnum.getName());
        }
        return enumsMap;
    }

    public String getStatusStr()
    {
        // 根据状态值获取字符串描述
    	ASysWebSiteEnum[] aSysWebSiteEnums = ASysWebSiteEnum.values();
        for (int i = 0; i < aSysWebSiteEnums.length; i++)
        {
        	ASysWebSiteEnum aSysWebSiteEnum = aSysWebSiteEnums[i];
            if (aSysWebSiteEnum.toString().startsWith("STATUS_"))
            {
                // 表示是状态的标识
                if (aSysWebSiteEnum.getStatus() == this.getStatus())
                {
                    this.statusStr = aSysWebSiteEnum.getName();
                    break;
                }
            }
        }
        return statusStr;
    }
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public byte getStatus() {
		return status;
	}
	public void setStatus(byte status) {
		this.status = status;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public Date getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	public Date getPubTime() {
		return pubTime;
	}
	public void setPubTime(Date pubTime) {
		this.pubTime = pubTime;
	}
	
	
}
